﻿using System.Collections.Generic;
using winS.UnityEditor.Undo;

namespace winS.UnityEditor.ProcessEditor
{
    public class GroupCommand : IUndoCommand
    {
        public string info { get; }

        private readonly IEnumerable<IUndoCommand> undoCommands;

        public GroupCommand(string info, IEnumerable<IUndoCommand> undoCommands)
        {
            this.info = info;
            this.undoCommands = undoCommands;
        }

        public void Redo()
        {
            foreach (var undoCommand in undoCommands) undoCommand.Redo();
        }
        public void Undo()
        {
            foreach (var undoCommand in undoCommands) undoCommand.Undo();
        }
    }
}